!function(e,t){function n(t){e.extend(!0,yt,t)}function r(n,r,l){function u(e){Q?(S(),E(),O(),w(e)):d()}function d(){Z=r.theme?"ui":"fc",n.addClass("fc"),r.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr"),r.theme&&n.addClass("ui-widget"),Q=e("<div class='fc-content' style='position:relative'/>").prependTo(n),G=new o(X,r),J=G.render(),J&&n.prepend(J),y(r.defaultView),e(window).resize(x),v()||h()}function h(){setTimeout(function(){!et.start&&v()&&w()},0)}function m(){e(window).unbind("resize",x),G.destroy(),Q.remove(),n.removeClass("fc fc-rtl ui-widget")}function g(){return 0!==st.offsetWidth}function v(){return 0!==e("body")[0].offsetWidth}function y(t){if(!et||t!=et.name){ut++,k();var n,r=et;r?((r.beforeHide||F)(),W(Q,Q.height()),r.element.hide()):W(Q,1),Q.css("overflow","hidden"),et=ct[t],et?et.element.show():et=ct[t]=new bt[t](n=rt=e("<div class='fc-view fc-view-"+t+"' style='position:absolute'/>").appendTo(Q),X),r&&G.deactivateButton(r.name),G.activateButton(t),w(),Q.css("overflow",""),r&&W(Q,1),n||(et.afterShow||F)(),ut--}}function w(e){if(g()){ut++,k(),nt===t&&S();var r=!1;!et.start||e||dt<et.start||dt>=et.end?(et.render(dt,e||0),T(!0),r=!0):et.sizeDirty?(et.clearEvents(),T(),r=!0):et.eventsDirty&&(et.clearEvents(),r=!0),et.sizeDirty=!1,et.eventsDirty=!1,D(r),tt=n.outerWidth(),G.updateTitle(et.title);var o=new Date;o>=et.start&&o<et.end?G.disableButton("today"):G.enableButton("today"),ut--,et.trigger("viewDisplay",st)}}function N(){E(),g()&&(S(),T(),k(),et.clearEvents(),et.renderEvents(ft),et.sizeDirty=!1)}function E(){e.each(ct,function(e,t){t.sizeDirty=!0})}function S(){nt=r.contentHeight?r.contentHeight:r.height?r.height-(J?J.height():0)-H(Q):Math.round(Q.width()/Math.max(r.aspectRatio,.5))}function T(e){ut++,et.setHeight(nt,e),rt&&(rt.css("position","relative"),rt=null),et.setWidth(Q.width(),e),ut--}function x(){if(!ut)if(et.start){var e=++lt;setTimeout(function(){e==lt&&!ut&&g()&&tt!=(tt=n.outerWidth())&&(ut++,N(),et.trigger("windowResize",st),ut--)},200)}else h()}function D(e){!r.lazyFetching||it(et.visStart,et.visEnd)?R():e&&A()}function R(){at(et.visStart,et.visEnd)}function _(e){ft=e,A()}function M(e){A(e)}function A(e){O(),g()&&(et.clearEvents(),et.renderEvents(ft,e),et.eventsDirty=!1)}function O(){e.each(ct,function(e,t){t.eventsDirty=!0})}function L(e,n,r){et.select(e,n,r===t?!0:r)}function k(){et&&et.unselect()}function I(){w(-1)}function P(){w(1)}function B(){a(dt,-1),w()}function z(){a(dt,1),w()}function $(){dt=new Date,w()}function V(e,t,n){e instanceof Date?dt=f(e):p(dt,e,t,n),w()}function q(e,n,r){e!==t&&a(dt,e),n!==t&&s(dt,n),r!==t&&c(dt,r),w()}function Y(){return f(dt)}function U(){return et}function j(e,n){return n===t?r[e]:(("height"==e||"contentHeight"==e||"aspectRatio"==e)&&(r[e]=n,N()),void 0)}function K(e,t){return r[e]?r[e].apply(t||st,Array.prototype.slice.call(arguments,2)):void 0}var X=this;X.options=r,X.render=u,X.destroy=m,X.refetchEvents=R,X.reportEvents=_,X.reportEventChange=M,X.rerenderEvents=A,X.changeView=y,X.select=L,X.unselect=k,X.prev=I,X.next=P,X.prevYear=B,X.nextYear=z,X.today=$,X.gotoDate=V,X.incrementDate=q,X.formatDate=function(e,t){return C(e,t,r)},X.formatDates=function(e,t,n){return b(e,t,n,r)},X.getDate=Y,X.getView=U,X.option=j,X.trigger=K,i.call(X,r,l);var G,J,Q,Z,et,tt,nt,rt,ot,it=X.isFetchNeeded,at=X.fetchEvents,st=n[0],ct={},lt=0,ut=0,dt=new Date,ft=[];p(dt,r.year,r.month,r.date),r.droppable&&e(document).bind("dragstart",function(t,n){var o=t.target,i=e(o);if(!i.parents(".fc").length){var a=r.dropAccept;(e.isFunction(a)?a.call(o,i):i.is(a))&&(ot=o,et.dragStart(ot,t,n))}}).bind("dragstop",function(e,t){ot&&(et.dragStop(ot,e,t),ot=null)})}function o(t,n){function r(){f=n.theme?"ui":"fc";var t=n.header;return t?h=e("<table class='fc-header' style='width:100%'/>").append(e("<tr/>").append(i("left")).append(i("center")).append(i("right"))):void 0}function o(){h.remove()}function i(r){var o=e("<td class='fc-header-"+r+"'/>"),i=n.header[r];return i&&e.each(i.split(" "),function(r){r>0&&o.append("<span class='fc-header-space'/>");var i;e.each(this.split(","),function(r,a){if("title"==a)o.append("<span class='fc-header-title'><h2>&nbsp;</h2></span>"),i&&i.addClass(f+"-corner-right"),i=null;else{var s;if(t[a]?s=t[a]:bt[a]&&(s=function(){u.removeClass(f+"-state-hover"),t.changeView(a)}),s){var c=n.theme?Y(n.buttonIcons,a):null,l=Y(n.buttonText,a),u=e("<span class='fc-button fc-button-"+a+" "+f+"-state-default'>"+(c?"<span class='fc-icon-wrap'><span class='ui-icon ui-icon-"+c+"'/>"+"</span>":l)+"</span>").click(function(){u.hasClass(f+"-state-disabled")||s()}).mousedown(function(){u.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-down")}).mouseup(function(){u.removeClass(f+"-state-down")}).hover(function(){u.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-hover")},function(){u.removeClass(f+"-state-hover").removeClass(f+"-state-down")}).appendTo(o);K(u),i||u.addClass(f+"-corner-left"),i=u}}}),i&&i.addClass(f+"-corner-right")}),o}function a(e){h.find("h2").html(e)}function s(e){h.find("span.fc-button-"+e).addClass(f+"-state-active")}function c(e){h.find("span.fc-button-"+e).removeClass(f+"-state-active")}function l(e){h.find("span.fc-button-"+e).addClass(f+"-state-disabled")}function u(e){h.find("span.fc-button-"+e).removeClass(f+"-state-disabled")}var d=this;d.render=r,d.destroy=o,d.updateTitle=a,d.activateButton=s,d.deactivateButton=c,d.disableButton=l,d.enableButton=u;var f,h=e([])}function i(n,r){function o(e,t){return!S||S>e||t>T}function i(e,t){S=e,T=t,k=[];var n=++A,r=M.length;O=r;for(var o=0;r>o;o++)a(M[o],n)}function a(t,r){s(t,function(o){if(r==A){if(o){n.eventDataTransform&&(o=e.map(o,n.eventDataTransform)),t.eventDataTransform&&(o=e.map(o,t.eventDataTransform));for(var i=0;i<o.length;i++)o[i].source=t,w(o[i]);k=k.concat(o)}O--,O||R(k)}})}function s(t,r){var o,i,a=Ct.sourceFetchers;for(o=0;o<a.length;o++){if(i=a[o](t,S,T,r),i===!0)return;if("object"==typeof i)return s(i,r),void 0}var c=t.events;if(c)e.isFunction(c)?(p(),c(f(S),f(T),function(e){r(e),y()})):e.isArray(c)?r(c):r();else{var l=t.url;if(l){var u=t.success,d=t.error,h=t.complete,m=e.extend({},t.data||{}),g=Z(t.startParam,n.startParam),v=Z(t.endParam,n.endParam);g&&(m[g]=Math.round(+S/1e3)),v&&(m[v]=Math.round(+T/1e3)),p(),e.ajax(e.extend({},Nt,t,{data:m,success:function(t){t=t||[];var n=Q(u,this,arguments);e.isArray(n)&&(t=n),r(t)},error:function(){Q(d,this,arguments),r()},complete:function(){Q(h,this,arguments),y()}}))}else r()}}function c(e){e=l(e),e&&(O++,a(e,A))}function l(t){return e.isFunction(t)||e.isArray(t)?t={events:t}:"string"==typeof t&&(t={url:t}),"object"==typeof t?(C(t),M.push(t),t):void 0}function u(t){M=e.grep(M,function(e){return!b(e,t)}),k=e.grep(k,function(e){return!b(e.source,t)}),R(k)}function d(e){var t,n,r=k.length,o=D().defaultEventEnd,i=e.start-e._start,a=e.end?e.end-(e._end||o(e)):0;for(t=0;r>t;t++)n=k[t],n._id==e._id&&n!=e&&(n.start=new Date(+n.start+i),n.end=e.end?n.end?new Date(+n.end+a):new Date(+o(n)+a):null,n.title=e.title,n.url=e.url,n.allDay=e.allDay,n.className=e.className,n.editable=e.editable,n.color=e.color,n.backgroudColor=e.backgroudColor,n.borderColor=e.borderColor,n.textColor=e.textColor,w(n));w(e),R(k)}function h(e,t){w(e),e.source||(t&&(_.events.push(e),e.source=_),k.push(e)),R(k)}function m(t){if(t){if(!e.isFunction(t)){var n=t+"";t=function(e){return e._id==n}}k=e.grep(k,t,!0);for(var r=0;r<M.length;r++)e.isArray(M[r].events)&&(M[r].events=e.grep(M[r].events,t,!0))}else{k=[];for(var r=0;r<M.length;r++)e.isArray(M[r].events)&&(M[r].events=[])}R(k)}function g(t){return e.isFunction(t)?e.grep(k,t):t?(t+="",e.grep(k,function(e){return e._id==t})):k}function p(){L++||x("loading",null,!0)}function y(){--L||x("loading",null,!1)}function w(e){var r=e.source||{},o=Z(r.ignoreTimezone,n.ignoreTimezone);e._id=e._id||(e.id===t?"_fc"+Et++:e.id+""),e.date&&(e.start||(e.start=e.date),delete e.date),e._start=f(e.start=v(e.start,o)),e.end=v(e.end,o),e.end&&e.end<=e.start&&(e.end=null),e._end=e.end?f(e.end):null,e.allDay===t&&(e.allDay=Z(r.allDayDefault,n.allDayDefault)),e.className?"string"==typeof e.className&&(e.className=e.className.split(/\s+/)):e.className=[]}function C(e){e.className?"string"==typeof e.className&&(e.className=e.className.split(/\s+/)):e.className=[];for(var t=Ct.sourceNormalizers,n=0;n<t.length;n++)t[n](e)}function b(e,t){return e&&t&&N(e)==N(t)}function N(e){return("object"==typeof e?e.events||e.url:"")||e}var E=this;E.isFetchNeeded=o,E.fetchEvents=i,E.addEventSource=c,E.removeEventSource=u,E.updateEvent=d,E.renderEvent=h,E.removeEvents=m,E.clientEvents=g,E.normalizeEvent=w;for(var S,T,x=E.trigger,D=E.getView,R=E.reportEvents,_={events:[]},M=[_],A=0,O=0,L=0,k=[],I=0;I<r.length;I++)l(r[I])}function a(e,t,n){return e.setFullYear(e.getFullYear()+t),n||d(e),e}function s(e,t,n){if(+e){var r=e.getMonth()+t,o=f(e);for(o.setDate(1),o.setMonth(r),e.setMonth(r),n||d(e);e.getMonth()!=o.getMonth();)e.setDate(e.getDate()+(o>e?1:-1))}return e}function c(e,t,n){if(+e){var r=e.getDate()+t,o=f(e);o.setHours(9),o.setDate(r),e.setDate(r),n||d(e),l(e,o)}return e}function l(e,t){if(+e)for(;e.getDate()!=t.getDate();)e.setTime(+e+(t>e?1:-1)*xt)}function u(e,t){return e.setMinutes(e.getMinutes()+t),e}function d(e){return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function f(e,t){return t?d(new Date(+e)):new Date(+e)}function h(){var e,t=0;do e=new Date(1970,t++,1);while(e.getHours());return e}function m(e,t,n){for(t=t||1;!e.getDay()||n&&1==e.getDay()||!n&&6==e.getDay();)c(e,t);return e}function g(e,t){return Math.round((f(e,!0)-f(t,!0))/Tt)}function p(e,n,r,o){n!==t&&n!=e.getFullYear()&&(e.setDate(1),e.setMonth(0),e.setFullYear(n)),r!==t&&r!=e.getMonth()&&(e.setDate(1),e.setMonth(r)),o!==t&&e.setDate(o)}function v(e,n){return"object"==typeof e?e:"number"==typeof e?new Date(1e3*e):"string"==typeof e?e.match(/^\d+(\.\d+)?$/)?new Date(1e3*parseFloat(e)):(n===t&&(n=!0),y(e,n)||(e?new Date(e):null)):null}function y(e,t){var n=e.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);if(!n)return null;var r=new Date(n[1],0,1);if(t||!n[13]){var o=new Date(n[1],0,1,9,0);n[3]&&(r.setMonth(n[3]-1),o.setMonth(n[3]-1)),n[5]&&(r.setDate(n[5]),o.setDate(n[5])),l(r,o),n[7]&&r.setHours(n[7]),n[8]&&r.setMinutes(n[8]),n[10]&&r.setSeconds(n[10]),n[12]&&r.setMilliseconds(1e3*Number("0."+n[12])),l(r,o)}else if(r.setUTCFullYear(n[1],n[3]?n[3]-1:0,n[5]||1),r.setUTCHours(n[7]||0,n[8]||0,n[10]||0,n[12]?1e3*Number("0."+n[12]):0),n[14]){var i=60*Number(n[16])+(n[18]?Number(n[18]):0);i*="-"==n[15]?1:-1,r=new Date(+r+1e3*60*i)}return r}function w(e){if("number"==typeof e)return 60*e;if("object"==typeof e)return 60*e.getHours()+e.getMinutes();var t=e.match(/(\d+)(?::(\d+))?\s*(\w+)?/);if(t){var n=parseInt(t[1],10);return t[3]&&(n%=12,"p"==t[3].toLowerCase().charAt(0)&&(n+=12)),60*n+(t[2]?parseInt(t[2],10):0)}}function C(e,t,n){return b(e,null,t,n)}function b(e,t,n,r){r=r||yt;var o,i,a,s,c=e,l=t,u=n.length,d="";for(o=0;u>o;o++)if(i=n.charAt(o),"'"==i){for(a=o+1;u>a;a++)if("'"==n.charAt(a)){c&&(d+=a==o+1?"'":n.substring(o+1,a),o=a);break}}else if("("==i){for(a=o+1;u>a;a++)if(")"==n.charAt(a)){var f=C(c,n.substring(o+1,a),r);parseInt(f.replace(/\D/,""),10)&&(d+=f),o=a;break}}else if("["==i){for(a=o+1;u>a;a++)if("]"==n.charAt(a)){var h=n.substring(o+1,a),f=C(c,h,r);f!=C(l,h,r)&&(d+=f),o=a;break}}else if("{"==i)c=t,l=e;else if("}"==i)c=e,l=t;else{for(a=u;a>o;a--)if(s=Rt[n.substring(o,a)]){c&&(d+=s(c,r)),o=a-1;break}a==o&&c&&(d+=i)}return d}function N(e){var t,n=new Date(e.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),t=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((t-n)/864e5)/7)+1}function E(e){return e.end?S(e.end,e.allDay):c(f(e.start),1)}function S(e,t){return e=f(e),t||e.getHours()||e.getMinutes()?c(e,1):d(e)}function T(e,t){return 100*(t.msLength-e.msLength)+(e.event.start-t.event.start)}function x(e,t){return e.end>t.start&&e.start<t.end}function D(e,t,n,r){var o,i,a,s,c,l,u,d,h=[],m=e.length;for(o=0;m>o;o++)i=e[o],a=i.start,s=t[o],s>n&&r>a&&(n>a?(c=f(n),u=!1):(c=a,u=!0),s>r?(l=f(r),d=!1):(l=s,d=!0),h.push({event:i,start:c,end:l,isStart:u,isEnd:d,msLength:l-c}));return h.sort(T)}function R(e){var t,n,r,o,i,a=[],s=e.length;for(t=0;s>t;t++){for(n=e[t],r=0;;){if(o=!1,a[r])for(i=0;i<a[r].length;i++)if(x(a[r][i],n)){o=!0;break}if(!o)break;r++}a[r]?a[r].push(n):a[r]=[n]}return a}function _(n,r,o){n.unbind("mouseover").mouseover(function(n){for(var i,a,s,c=n.target;c!=this;)i=c,c=c.parentNode;(a=i._fci)!==t&&(i._fci=t,s=r[a],o(s.event,s.element,s),e(n.target).trigger(n)),n.stopPropagation()})}function M(t,n,r){for(var o,i=0;i<t.length;i++)o=e(t[i]),o.width(Math.max(0,n-O(o,r)))}function A(t,n,r){for(var o,i=0;i<t.length;i++)o=e(t[i]),o.height(Math.max(0,n-H(o,r)))}function O(e,t){return L(e)+I(e)+(t?k(e):0)}function L(t){return(parseFloat(e.css(t[0],"paddingLeft",!0))||0)+(parseFloat(e.css(t[0],"paddingRight",!0))||0)}function k(t){return(parseFloat(e.css(t[0],"marginLeft",!0))||0)+(parseFloat(e.css(t[0],"marginRight",!0))||0)}function I(t){return(parseFloat(e.css(t[0],"borderLeftWidth",!0))||0)+(parseFloat(e.css(t[0],"borderRightWidth",!0))||0)}function H(e,t){return P(e)+z(e)+(t?B(e):0)}function P(t){return(parseFloat(e.css(t[0],"paddingTop",!0))||0)+(parseFloat(e.css(t[0],"paddingBottom",!0))||0)}function B(t){return(parseFloat(e.css(t[0],"marginTop",!0))||0)+(parseFloat(e.css(t[0],"marginBottom",!0))||0)}function z(t){return(parseFloat(e.css(t[0],"borderTopWidth",!0))||0)+(parseFloat(e.css(t[0],"borderBottomWidth",!0))||0)}function W(e,t){t="number"==typeof t?t+"px":t,e.each(function(e,n){n.style.cssText+=";min-height:"+t+";_height:"+t})}function F(){}function $(e,t){return e-t}function V(e){return Math.max.apply(Math,e)}function q(e){return(10>e?"0":"")+e}function Y(e,n){if(e[n]!==t)return e[n];for(var r,o=n.split(/(?=[A-Z])/),i=o.length-1;i>=0;i--)if(r=e[o[i].toLowerCase()],r!==t)return r;return e[""]}function U(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function j(e){return e.id+"/"+e.className+"/"+e.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/gi,"")}function K(e){e.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function X(e){e.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function G(e,t){e.each(function(e,n){n.className=n.className.replace(/^fc-\w*/,"fc-"+St[t.getDay()])})}function J(e,t){var n=e.source||{},r=e.color,o=n.color,i=t("eventColor"),a=e.backgroundColor||r||n.backgroundColor||o||t("eventBackgroundColor")||i,s=e.borderColor||r||n.borderColor||o||t("eventBorderColor")||i,c=e.textColor||n.textColor||t("eventTextColor"),l=[];return a&&l.push("background-color:"+a),s&&l.push("border-color:"+s),c&&l.push("color:"+c),l.join(";")}function Q(t,n,r){if(e.isFunction(t)&&(t=[t]),t){var o,i;for(o=0;o<t.length;o++)i=t[o].apply(n,r)||i;return i}}function Z(){for(var e=0;e<arguments.length;e++)if(arguments[e]!==t)return arguments[e]}function et(e,t){function n(e,t){t&&(s(e,t),e.setDate(1));var n=f(e,!0);n.setDate(1);var l=s(f(n),1),u=f(n),d=f(l),h=o("firstDay"),g=o("weekends")?0:1;g&&(m(u),m(d,-1,!0)),c(u,-((u.getDay()-Math.max(h,g)+7)%7)),c(d,(7-d.getDay()+Math.max(h,g))%7);var p=Math.round((d-u)/(7*Tt));"fixed"==o("weekMode")&&(c(d,7*(6-p)),p=6),r.title=a(n,o("titleFormat")),r.start=n,r.end=l,r.visStart=u,r.visEnd=d,i(p,g?5:7,!0)}var r=this;r.render=n,rt.call(r,e,t,"month");var o=r.opt,i=r.renderBasic,a=t.formatDate}function tt(e,t){function n(e,t){t&&c(e,7*t);var n=c(f(e),-((e.getDay()-o("firstDay")+7)%7)),s=c(f(n),7),l=f(n),u=f(s),d=o("weekends");d||(m(l),m(u,-1,!0)),r.title=a(l,c(f(u),-1),o("titleFormat")),r.start=n,r.end=s,r.visStart=l,r.visEnd=u,i(1,d?7:5,!1)}var r=this;r.render=n,rt.call(r,e,t,"basicWeek");var o=r.opt,i=r.renderBasic,a=t.formatDates}function nt(e,t){function n(e,t){t&&(c(e,t),o("weekends")||m(e,0>t?-1:1)),r.title=a(e,o("titleFormat")),r.start=r.visStart=f(e,!0),r.end=r.visEnd=c(f(r.start),1),i(1,1,!1)}var r=this;r.render=n,rt.call(r,e,t,"basicDay");var o=r.opt,i=r.renderBasic,a=t.formatDate}function rt(t,n,r){function o(e,t,n){nt=e,rt=t,i();var r=!q;r?a():Dt(),s(n)}function i(){ct=Tt("isRTL"),ct?(lt=-1,dt=rt-1):(lt=1,dt=0),pt=Tt("firstDay"),yt=Tt("weekends")?0:1,wt=Tt("theme")?"ui":"fc",Ct=Tt("columnFormat"),bt=Tt("weekNumbers"),Nt=Tt("weekNumberTitle"),Et="iso"!=Tt("weekNumberCalculation")?"w":"W"}function a(){J=e("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(t)}function s(n){var r,o,i,a,s="",c=wt+"-widget-header",l=wt+"-widget-content",u=z.start.getMonth(),f=d(new Date);for(s+="<table class='fc-border-separate' style='width:100%' cellspacing='0'><thead><tr>",bt&&(s+="<th class='fc-week-number "+c+"'/>"),r=0;rt>r;r++)i=A(0,r),s+="<th class='fc-day-header fc-"+St[i.getDay()]+" "+c+"'/>";for(s+="</tr></thead><tbody>",r=0;nt>r;r++){for(s+="<tr class='fc-week'>",bt&&(s+="<td class='fc-week-number "+l+"'>"+"<div/>"+"</td>"),o=0;rt>o;o++)i=A(r,o),a=["fc-day","fc-"+St[i.getDay()],l],i.getMonth()!=u&&a.push("fc-other-month"),+i==+f&&(a.push("fc-today"),a.push(wt+"-state-highlight")),s+="<td class='"+a.join(" ")+"'"+" data-date='"+At(i,"yyyy-MM-dd")+"'"+">"+"<div>",n&&(s+="<div class='fc-day-number'>"+i.getDate()+"</div>"),s+="<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";s+="</tr>"}s+="</tbody></table>",P(),F&&F.remove(),F=e(s).appendTo(t),$=F.find("thead"),V=$.find(".fc-day-header"),q=F.find("tbody"),Y=q.find("tr"),U=q.find(".fc-day"),j=Y.find("td:first-child"),G=Y.eq(0).find(".fc-day-content > div"),X($.add($.find("tr"))),X(Y),Y.eq(0).addClass("fc-first"),Y.filter(":last").addClass("fc-last"),bt&&$.find(".fc-week-number").text(Nt),V.each(function(t,n){var r=O(t);e(n).text(At(r,Ct))}),bt&&q.find(".fc-week-number > div").each(function(t,n){var r=A(t,0);e(n).text(At(r,Et))}),U.each(function(t,n){var r=O(t);xt("dayRender",z,r,e(n))}),h(U)}function l(t){Z=t;var n,r,o,i=Z-$.height();"variable"==Tt("weekMode")?n=r=Math.floor(i/(1==nt?2:6)):(n=Math.floor(i/nt),r=i-n*(nt-1)),j.each(function(t,i){nt>t&&(o=e(i),W(o.find("> div"),(t==nt-1?r:n)-H(o)))}),B()}function u(e){Q=e,st.clear(),tt=0,bt&&(tt=$.find("th.fc-week-number").outerWidth()),et=Math.floor((Q-tt)/rt),M(V.slice(0,-1),et)}function h(e){e.click(m).mousedown(Mt)}function m(t){if(!Tt("selectable")){var n=y(e(this).data("date"));xt("dayClick",this,n,!0,t)}}function p(e,t,n){n&&it.build();for(var r=f(z.visStart),o=c(f(r),rt),i=0;nt>i;i++){var a=new Date(Math.max(r,e)),s=new Date(Math.min(o,t));if(s>a){var l,u;ct?(l=g(s,r)*lt+dt+1,u=g(a,r)*lt+dt+1):(l=g(a,r),u=g(s,r)),h(v(i,l,i,u-1))}c(r,7),c(o,7)}}function v(e,n,r,o){var i=it.rect(e,n,r,o,t);return Rt(i,t)}function w(e){return f(e)}function C(e,t){p(e,c(f(t),1),!0)}function b(){_t()}function N(e,t,n){var r=R(e),o=U[r.row*rt+r.col];xt("dayClick",o,e,t,n)}function E(e,t){at.start(function(e){_t(),e&&v(e.row,e.col,e.row,e.col)},t)}function S(e,t,n){var r=at.stop();if(_t(),r){var o=_(r);xt("drop",e,o,!0,t,n)}}function T(e){return f(e.start)}function x(e){return st.left(e)}function D(e){return st.right(e)}function R(e){return{row:Math.floor(g(e,z.visStart)/7),col:L(e.getDay())}}function _(e){return A(e.row,e.col)}function A(e,t){return c(f(z.visStart),7*e+t*lt+dt)}function O(e){return A(Math.floor(e/rt),e%rt)}function L(e){return(e-Math.max(pt,yt)+rt)%rt*lt+dt}function k(e){return Y.eq(e)}function I(){var e=0;return bt&&(e+=tt),{left:e,right:Q}}function P(){W(t,t.height())}function B(){W(t,1)}var z=this;z.renderBasic=o,z.setHeight=l,z.setWidth=u,z.renderDayOverlay=p,z.defaultSelectionEnd=w,z.renderSelection=C,z.clearSelection=b,z.reportDayClick=N,z.dragStart=E,z.dragStop=S,z.defaultEventEnd=T,z.getHoverListener=function(){return at},z.colContentLeft=x,z.colContentRight=D,z.dayOfWeekCol=L,z.dateCell=R,z.cellDate=_,z.cellIsAllDay=function(){return!0},z.allDayRow=k,z.allDayBounds=I,z.getRowCnt=function(){return nt},z.getColCnt=function(){return rt},z.getColWidth=function(){return et},z.getDaySegmentContainer=function(){return J},ut.call(z,t,n,r),ht.call(z),ft.call(z),ot.call(z);var F,$,V,q,Y,U,j,G,J,Q,Z,et,tt,nt,rt,it,at,st,ct,lt,dt,pt,yt,wt,Ct,bt,Nt,Et,Tt=z.opt,xt=z.trigger,Dt=z.clearEvents,Rt=z.renderOverlay,_t=z.clearOverlays,Mt=z.daySelectionMousedown,At=n.formatDate;K(t.addClass("fc-grid")),it=new mt(function(t,n){var r,o,i;V.each(function(t,a){r=e(a),o=r.offset().left,t&&(i[1]=o),i=[o],n[t]=i}),i[1]=o+r.outerWidth(),Y.each(function(n,a){nt>n&&(r=e(a),o=r.offset().top,n&&(i[1]=o),i=[o],t[n]=i)}),i[1]=o+r.outerHeight()}),at=new gt(it),st=new vt(function(e){return G.eq(e)})}function ot(){function t(e,t){h(e),x(r(e),t),l("eventAfterAllRender")}function n(){m(),w().empty()}function r(t){var n,r,o,i,s,l,u=S(),d=T(),h=f(a.visStart),m=c(f(h),d),g=e.map(t,E),p=[];for(n=0;u>n;n++){for(r=R(D(t,g,h,m)),o=0;o<r.length;o++)for(i=r[o],s=0;s<i.length;s++)l=i[s],l.row=n,l.level=o,p.push(l);c(h,7),c(m,7)}return p}function o(e,t,n){u(e)&&i(e,t),n.isEnd&&d(e)&&_(e,t,n),g(e,t)}function i(e,t){var n,r=C();t.draggable({zIndex:9,delay:50,opacity:s("dragOpacity"),revertDuration:s("dragRevertDuration"),start:function(o,i){l("eventDragStart",t,e,o,i),v(e,t),r.start(function(r,o,i,a){t.draggable("option","revert",!r||!i&&!a),N(),r?(n=7*i+a*(s("isRTL")?-1:1),b(c(f(e.start),n),c(E(e),n))):n=0},o,"drag")},stop:function(o,i){r.stop(),N(),l("eventDragStop",t,e,o,i),n?y(this,e,n,0,e.allDay,o,i):(t.css("filter",""),p(e,t))}})}var a=this;a.renderEvents=t,a.compileDaySegs=r,a.clearEvents=n,a.bindDaySeg=o,dt.call(a);var s=a.opt,l=a.trigger,u=a.isEventDraggable,d=a.isEventResizable,h=a.reportEvents,m=a.reportEventClear,g=a.eventElementHandlers,p=a.showEvents,v=a.hideEvents,y=a.eventDrop,w=a.getDaySegmentContainer,C=a.getHoverListener,b=a.renderDayOverlay,N=a.clearOverlays,S=a.getRowCnt,T=a.getColCnt,x=a.renderDaySegs,_=a.resizableDayEvent}function it(e,t){function n(e,t){t&&c(e,7*t);var n=c(f(e),-((e.getDay()-o("firstDay")+7)%7)),s=c(f(n),7),l=f(n),u=f(s),d=o("weekends");d||(m(l),m(u,-1,!0)),r.title=a(l,c(f(u),-1),o("titleFormat")),r.start=n,r.end=s,r.visStart=l,r.visEnd=u,i(d?7:5)}var r=this;r.render=n,st.call(r,e,t,"agendaWeek");var o=r.opt,i=r.renderAgenda,a=t.formatDates}function at(e,t){function n(e,t){t&&(c(e,t),o("weekends")||m(e,0>t?-1:1));var n=f(e,!0),s=c(f(n),1);r.title=a(e,o("titleFormat")),r.start=r.visStart=n,r.end=r.visEnd=s,i(1)}var r=this;r.render=n,st.call(r,e,t,"agendaDay");var o=r.opt,i=r.renderAgenda,a=t.formatDate}function st(n,r,o){function i(e){Ht=e,a(),et?nn():s(),l()}function a(){$t=en("theme")?"ui":"fc",qt=en("weekends")?0:1,Vt=en("firstDay"),(Yt=en("isRTL"))?(Ut=-1,jt=Ht-1):(Ut=1,jt=0),Kt=w(en("minTime")),Xt=w(en("maxTime")),Gt=en("columnFormat"),Jt=en("weekNumbers"),Qt=en("weekNumberTitle"),Zt="iso"!=en("weekNumberCalculation")?"w":"W",Lt=en("snapMinutes")||en("slotMinutes")}function s(){var t,r,o,i,a,s=$t+"-widget-header",c=$t+"-widget-content",l=0==en("slotMinutes")%15;for(t="<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'><thead><tr>",t+=Jt?"<th class='fc-agenda-axis fc-week-number "+s+"'/>":"<th class='fc-agenda-axis "+s+"'>&nbsp;</th>",r=0;Ht>r;r++)t+="<th class='fc- fc-col"+r+" "+s+"'/>";for(t+="<th class='fc-agenda-gutter "+s+"'>&nbsp;</th>"+"</tr>"+"</thead>"+"<tbody>"+"<tr>"+"<th class='fc-agenda-axis "+s+"'>&nbsp;</th>",r=0;Ht>r;r++)t+="<td class='fc- fc-col"+r+" "+c+"'>"+"<div>"+"<div class='fc-day-content'>"+"<div style='position:relative'>&nbsp;</div>"+"</div>"+"</div>"+"</td>";for(t+="<td class='fc-agenda-gutter "+c+"'>&nbsp;</td>"+"</tr>"+"</tbody>"+"</table>",et=e(t).appendTo(n),tt=et.find("thead"),nt=tt.find("th").slice(1,-1),rt=et.find("tbody"),ot=rt.find("td").slice(0,-1),it=ot.find("div.fc-day-content div"),at=ot.eq(0),st=at.find("> div"),X(tt.add(tt.find("tr"))),X(rt.add(rt.find("tr"))),St=tt.find("th:first"),Tt=et.find(".fc-agenda-gutter"),lt=e("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(n),en("allDaySlot")?(dt=e("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(lt),t="<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='"+s+" fc-agenda-axis'>"+en("allDayText")+"</th>"+"<td>"+"<div class='fc-day-content'><div style='position:relative'/></div>"+"</td>"+"<th class='"+s+" fc-agenda-gutter'>&nbsp;</th>"+"</tr>"+"</table>",pt=e(t).appendTo(lt),yt=pt.find("tr"),b(yt.find("td")),St=St.add(pt.find("th:first")),Tt=Tt.add(pt.find("th.fc-agenda-gutter")),lt.append("<div class='fc-agenda-divider "+s+"'>"+"<div class='fc-agenda-divider-inner'/>"+"</div>")):dt=e([]),wt=e("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(lt),Ct=e("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(wt),bt=e("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(Ct),t="<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>",o=h(),i=u(f(o),Xt),u(o,Kt),Pt=0,r=0;i>o;r++)a=o.getMinutes(),t+="<tr class='fc-slot"+r+" "+(a?"fc-minor":"")+"'>"+"<th class='fc-agenda-axis "+s+"'>"+(l&&a?"&nbsp;":un(o,en("axisFormat")))+"</th>"+"<td class='"+c+"'>"+"<div style='position:relative'>&nbsp;</div>"+"</td>"+"</tr>",u(o,en("slotMinutes")),Pt++;t+="</tbody></table>",Nt=e(t).appendTo(Ct),Et=Nt.find("div:first"),N(Nt.find("td")),St=St.add(Nt.find("th:first"))}function l(){var e,t,n,r,o=d(new Date);if(Jt){var i=un(L(0),Zt);Yt?i+=Qt:i=Qt+i,tt.find(".fc-week-number").text(i)}for(e=0;Ht>e;e++)r=L(e),t=nt.eq(e),t.html(un(r,Gt)),n=ot.eq(e),+r==+o?n.addClass($t+"-state-highlight fc-today"):n.removeClass($t+"-state-highlight fc-today"),G(t.add(n),r)}function m(e,n){e===t&&(e=Rt),Rt=e,dn={};var r=rt.position().top,o=wt.position().top,i=Math.min(e-r,Nt.height()+o+1);st.height(i-H(at)),lt.css("top",r),wt.height(i-o-1),Ot=Et.height()+1,kt=en("slotMinutes")/Lt,It=Ot/kt,n&&v()}function p(t){Dt=t,Wt.clear(),_t=0,M(St.width("").each(function(t,n){_t=Math.max(_t,e(n).outerWidth())}),_t);var n=wt[0].clientWidth;At=wt.width()-n,At?(M(Tt,At),Tt.show().prev().removeClass("fc-last")):Tt.hide().prev().addClass("fc-last"),Mt=Math.floor((n-_t)/Ht),M(nt.slice(0,-1),Mt)}function v(){function e(){wt.scrollTop(r)}var t=h(),n=f(t);n.setHours(en("firstHour"));var r=P(t,n)+1;e(),setTimeout(e,0)}function y(){Ft=wt.scrollTop()}function C(){wt.scrollTop(Ft)}function b(e){e.click(E).mousedown(cn)}function N(e){e.click(E).mousedown(U)}function E(e){if(!en("selectable")){var t=Math.min(Ht-1,Math.floor((e.pageX-et.offset().left-_t)/Mt)),n=L(t),r=this.parentNode.className.match(/fc-slot(\d+)/);if(r){var o=parseInt(r[1])*en("slotMinutes"),i=Math.floor(o/60);n.setHours(i),n.setMinutes(o%60+Kt),tn("dayClick",ot[t],n,!1,e)}else tn("dayClick",ot[t],n,!0,e)}}function S(e,t,n){n&&Bt.build();var r,o,i=f(Z.visStart);Yt?(r=g(t,i)*Ut+jt+1,o=g(e,i)*Ut+jt+1):(r=g(e,i),o=g(t,i)),r=Math.max(0,r),o=Math.min(Ht,o),o>r&&b(T(0,r,0,o-1))}function T(e,t,n,r){var o=Bt.rect(e,t,n,r,lt);return rn(o,lt)}function x(e,t){for(var n=f(Z.visStart),r=c(f(n),1),o=0;Ht>o;o++){var i=new Date(Math.max(n,e)),a=new Date(Math.min(r,t));if(a>i){var s=o*Ut+jt,l=Bt.rect(0,s,0,s,Ct),u=P(n,i),d=P(n,a);l.top=u,l.height=d-u,N(rn(l,Ct))}c(n,1),c(r,1)}}function D(e){return Wt.left(e)}function R(e){return Wt.right(e)}function _(e){return{row:Math.floor(g(e,Z.visStart)/7),col:I(e.getDay())}}function O(e){var t=L(e.col),n=e.row;return en("allDaySlot")&&n--,n>=0&&u(t,Kt+n*Lt),t}function L(e){return c(f(Z.visStart),e*Ut+jt)}function k(e){return en("allDaySlot")&&!e.row}function I(e){return(e-Math.max(Vt,qt)+Ht)%Ht*Ut+jt}function P(e,n){if(e=f(e,!0),n<u(f(e),Kt))return 0;if(n>=u(f(e),Xt))return Nt.height();var r=en("slotMinutes"),o=60*n.getHours()+n.getMinutes()-Kt,i=Math.floor(o/r),a=dn[i];return a===t&&(a=dn[i]=Nt.find("tr:eq("+i+") td div")[0].offsetTop),Math.max(0,Math.round(a-1+Ot*(o%r/r)))}function B(){return{left:_t,right:Dt-At}}function z(){return yt}function W(e){var t=f(e.start);return e.allDay?t:u(t,en("defaultEventMinutes"))}function F(e,t){return t?f(e):u(f(e),en("slotMinutes"))}function V(e,t,n){n?en("allDaySlot")&&S(e,c(f(t),1),!0):q(e,t)}function q(t,n){var r=en("selectHelper");if(Bt.build(),r){var o=g(t,Z.visStart)*Ut+jt;if(o>=0&&Ht>o){var i=Bt.rect(0,o,0,o,Ct),a=P(t,t),s=P(t,n);if(s>a){if(i.top=a,i.height=s-a,i.left+=2,i.width-=5,e.isFunction(r)){var c=r(t,n);c&&(i.position="absolute",i.zIndex=8,xt=e(c).css(i).appendTo(Ct))}else i.isStart=!0,i.isEnd=!0,xt=e(ln({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},i)),xt.css("opacity",en("dragOpacity"));xt&&(N(xt),Ct.append(xt),M(xt,i.width,!0),A(xt,i.height,!0))}}}else x(t,n)}function Y(){on(),xt&&(xt.remove(),xt=null)}function U(t){if(1==t.which&&en("selectable")){sn(t);var n;zt.start(function(e,t){if(Y(),e&&e.col==t.col&&!k(e)){var r=O(t),o=O(e);n=[r,u(f(r),Lt),o,u(f(o),Lt)].sort($),q(n[0],n[3])}else n=null},t),e(document).one("mouseup",function(e){zt.stop(),n&&(+n[0]==+n[1]&&j(n[0],!1,e),an(n[0],n[3],!1,e))})}}function j(e,t,n){tn("dayClick",ot[I(e.getDay())],e,t,n)}function J(e,t){zt.start(function(e){if(on(),e)if(k(e))T(e.row,e.col,e.row,e.col);else{var t=O(e),n=u(f(t),en("defaultEventMinutes"));x(t,n)}},t)}function Q(e,t,n){var r=zt.stop();on(),r&&tn("drop",e,O(r),k(r),t,n)}var Z=this;Z.renderAgenda=i,Z.setWidth=p,Z.setHeight=m,Z.beforeHide=y,Z.afterShow=C,Z.defaultEventEnd=W,Z.timePosition=P,Z.dayOfWeekCol=I,Z.dateCell=_,Z.cellDate=O,Z.cellIsAllDay=k,Z.allDayRow=z,Z.allDayBounds=B,Z.getHoverListener=function(){return zt},Z.colContentLeft=D,Z.colContentRight=R,Z.getDaySegmentContainer=function(){return dt},Z.getSlotSegmentContainer=function(){return bt},Z.getMinMinute=function(){return Kt},Z.getMaxMinute=function(){return Xt},Z.getBodyContent=function(){return Ct},Z.getRowCnt=function(){return 1},Z.getColCnt=function(){return Ht},Z.getColWidth=function(){return Mt},Z.getSnapHeight=function(){return It},Z.getSnapMinutes=function(){return Lt},Z.defaultSelectionEnd=F,Z.renderDayOverlay=S,Z.renderSelection=V,Z.clearSelection=Y,Z.reportDayClick=j,Z.dragStart=J,Z.dragStop=Q,ut.call(Z,n,r,o),ht.call(Z),ft.call(Z),ct.call(Z);var et,tt,nt,rt,ot,it,at,st,lt,dt,pt,yt,wt,Ct,bt,Nt,Et,St,Tt,xt,Dt,Rt,_t,Mt,At,Ot,Lt,kt,It,Ht,Pt,Bt,zt,Wt,Ft,$t,Vt,qt,Yt,Ut,jt,Kt,Xt,Gt,Jt,Qt,Zt,en=Z.opt,tn=Z.trigger,nn=Z.clearEvents,rn=Z.renderOverlay,on=Z.clearOverlays,an=Z.reportSelection,sn=Z.unselect,cn=Z.daySelectionMousedown,ln=Z.slotSegHtml,un=r.formatDate,dn={};K(n.addClass("fc-agenda")),Bt=new mt(function(t,n){function r(e){return Math.max(c,Math.min(l,e))}var o,i,a;nt.each(function(t,r){o=e(r),i=o.offset().left,t&&(a[1]=i),a=[i],n[t]=a}),a[1]=i+o.outerWidth(),en("allDaySlot")&&(o=yt,i=o.offset().top,t[0]=[i,i+o.outerHeight()]);for(var s=Ct.offset().top,c=wt.offset().top,l=c+wt.outerHeight(),u=0;Pt*kt>u;u++)t.push([r(s+It*u),r(s+It*(u+1))])}),zt=new gt(Bt),Wt=new vt(function(e){return it.eq(e)})}function ct(){function n(e,t){S(e);var n,r=e.length,a=[],c=[];for(n=0;r>n;n++)e[n].allDay?a.push(e[n]):c.push(e[n]);y("allDaySlot")&&($(o(a),t),M()),s(i(c),t),w("eventAfterAllRender")}function r(){T(),L().empty(),k().empty()}function o(t){var n,r,o,i,a=R(D(t,e.map(t,E),v.visStart,v.visEnd)),s=a.length,c=[];for(n=0;s>n;n++)for(r=a[n],o=0;o<r.length;o++)i=r[o],i.row=0,i.level=n,c.push(i);return c}function i(t){var n,r,o,i,s,l,d=q(),h=B(),m=P(),g=u(f(v.visStart),h),p=e.map(t,a),y=[];for(n=0;d>n;n++){for(r=R(D(t,p,g,u(f(g),m-h))),lt(r),o=0;o<r.length;o++)for(i=r[o],s=0;s<i.length;s++)l=i[s],l.col=n,l.level=o,y.push(l);c(g,1,!0)}return y}function a(e){return e.end?f(e.end):u(f(e.start),y("defaultEventMinutes"))}function s(n,r){var o,i,a,s,c,u,d,f,m,g,p,v,C,b,N,E,S,T,x,D,R,M,A=n.length,L="",I={},P={},B=k(),$=q();for((D=y("isRTL"))?(R=-1,M=$-1):(R=1,M=0),o=0;A>o;o++)i=n[o],a=i.event,s=z(i.start,i.start),c=z(i.start,i.end),u=i.col,d=i.level,f=i.forward||0,m=W(u*R+M),g=F(u*R+M)-m,g=Math.min(g-6,.95*g),p=d?g/(d+f+1):f?2*(g/(f+1)-6):g,v=m+g/(d+f+1)*d*R+(D?g-p:0),i.top=s,i.left=v,i.outerWidth=p,i.outerHeight=c-s,L+=l(a,i);
for(B[0].innerHTML=L,C=B.children(),o=0;A>o;o++)i=n[o],a=i.event,b=e(C[o]),N=w("eventRender",a,a,b),N===!1?b.remove():(N&&N!==!0&&(b.remove(),b=e(N).css({position:"absolute",top:i.top,left:i.left}).appendTo(B)),i.element=b,a._id===r?h(a,b,i):b[0]._fci=o,Q(a,b));for(_(B,n,h),o=0;A>o;o++)i=n[o],(b=i.element)&&(S=I[E=i.key=j(b[0])],i.vsides=S===t?I[E]=H(b,!0):S,S=P[E],i.hsides=S===t?P[E]=O(b,!0):S,T=b.find(".fc-event-title"),T.length&&(i.contentTop=T[0].offsetTop));for(o=0;A>o;o++)i=n[o],(b=i.element)&&(b[0].style.width=Math.max(0,i.outerWidth-i.hsides)+"px",x=Math.max(0,i.outerHeight-i.vsides),b[0].style.height=x+"px",a=i.event,i.contentTop!==t&&x-i.contentTop<10&&(b.find("div.fc-event-time").text(at(a.start,y("timeFormat"))+" - "+a.title),b.find("div.fc-event-title").remove()),w("eventAfterRender",a,a,b))}function l(e,t){var n="<",r=e.url,o=J(e,y),i=["fc-event","fc-event-vert"];return C(e)&&i.push("fc-event-draggable"),t.isStart&&i.push("fc-event-start"),t.isEnd&&i.push("fc-event-end"),i=i.concat(e.className),e.source&&(i=i.concat(e.source.className||[])),n+=r?"a href='"+U(e.url)+"'":"div",n+=" class='"+i.join(" ")+"'"+" style='position:absolute;z-index:8;top:"+t.top+"px;left:"+t.left+"px;"+o+"'"+">"+"<div class='fc-event-inner'>"+"<div class='fc-event-time'>"+U(st(e.start,e.end,y("timeFormat")))+"</div>"+"<div class='fc-event-title'>"+U(e.title)+"</div>"+"</div>"+"<div class='fc-event-bg'></div>",t.isEnd&&b(e)&&(n+="<div class='ui-resizable-handle ui-resizable-s'>=</div>"),n+="</"+(r?"a":"div")+">"}function d(e,t,n){C(e)&&m(e,t,n.isStart),n.isEnd&&b(e)&&V(e,t,n),x(e,t)}function h(e,t,n){var r=t.find("div.fc-event-time");C(e)&&g(e,t,r),n.isEnd&&b(e)&&p(e,t,r),x(e,t)}function m(e,t,n){function r(){s||(t.width(o).height("").draggable("option","grid",null),s=!0)}var o,i,a,s=!0,l=y("isRTL")?-1:1,u=I(),d=Y(),h=K(),m=X(),g=B();t.draggable({zIndex:9,opacity:y("dragOpacity","month"),revertDuration:y("dragRevertDuration"),start:function(g,p){w("eventDragStart",t,e,g,p),et(e,t),o=t.width(),u.start(function(o,u,g,p){ot(),o?(i=!1,a=p*l,o.row?n?s&&(t.width(d-10),A(t,h*Math.round((e.end?(e.end-e.start)/Dt:y("defaultEventMinutes"))/m)),t.draggable("option","grid",[d,1]),s=!1):i=!0:(rt(c(f(e.start),a),c(E(e),a)),r()),i=i||s&&!a):(r(),i=!0),t.draggable("option","revert",i)},g,"drag")},stop:function(n,o){if(u.stop(),ot(),w("eventDragStop",t,e,n,o),i)r(),t.css("filter",""),Z(e,t);else{var c=0;s||(c=Math.round((t.offset().top-G().offset().top)/h)*m+g-(60*e.start.getHours()+e.start.getMinutes())),tt(this,e,a,c,s,n,o)}}})}function g(e,t,n){function r(t){var r,o=u(f(e.start),t);e.end&&(r=u(f(e.end),t)),n.text(st(o,r,y("timeFormat")))}function o(){d&&(n.css("display",""),t.draggable("option","grid",[p,v]),d=!1)}var i,a,s,l,d=!1,h=y("isRTL")?-1:1,m=I(),g=q(),p=Y(),v=K(),C=X();t.draggable({zIndex:9,scroll:!1,grid:[p,v],axis:1==g?"y":!1,opacity:y("dragOpacity"),revertDuration:y("dragRevertDuration"),start:function(r,u){w("eventDragStart",t,e,r,u),et(e,t),i=t.position(),s=l=0,m.start(function(r,i,s,l){t.draggable("option","revert",!r),ot(),r&&(a=l*h,y("allDaySlot")&&!r.row?(d||(d=!0,n.hide(),t.draggable("option","grid",null)),rt(c(f(e.start),a),c(E(e),a))):o())},r,"drag")},drag:function(e,t){s=Math.round((t.position.top-i.top)/v)*C,s!=l&&(d||r(s),l=s)},stop:function(n,c){var l=m.stop();ot(),w("eventDragStop",t,e,n,c),l&&(a||s||d)?tt(this,e,a,d?0:s,d,n,c):(o(),t.css("filter",""),t.css(i),r(0),Z(e,t))}})}function p(e,t,n){var r,o,i=K(),a=X();t.resizable({handles:{s:".ui-resizable-handle"},grid:i,start:function(n,i){r=o=0,et(e,t),t.css("z-index",9),w("eventResizeStart",this,e,n,i)},resize:function(s,c){r=Math.round((Math.max(i,t.height())-c.originalSize.height)/i),r!=o&&(n.text(st(e.start,r||e.end?u(N(e),a*r):null,y("timeFormat"))),o=r)},stop:function(n,o){w("eventResizeStop",this,e,n,o),r?nt(this,e,0,a*r,n,o):(t.css("z-index",8),Z(e,t))}})}var v=this;v.renderEvents=n,v.compileDaySegs=o,v.clearEvents=r,v.slotSegHtml=l,v.bindDaySeg=d,dt.call(v);var y=v.opt,w=v.trigger,C=v.isEventDraggable,b=v.isEventResizable,N=v.eventEnd,S=v.reportEvents,T=v.reportEventClear,x=v.eventElementHandlers,M=v.setHeight,L=v.getDaySegmentContainer,k=v.getSlotSegmentContainer,I=v.getHoverListener,P=v.getMaxMinute,B=v.getMinMinute,z=v.timePosition,W=v.colContentLeft,F=v.colContentRight,$=v.renderDaySegs,V=v.resizableDayEvent,q=v.getColCnt,Y=v.getColWidth,K=v.getSnapHeight,X=v.getSnapMinutes,G=v.getBodyContent,Q=v.reportEventElement,Z=v.showEvents,et=v.hideEvents,tt=v.eventDrop,nt=v.eventResize,rt=v.renderDayOverlay,ot=v.clearOverlays,it=v.calendar,at=it.formatDate,st=it.formatDates}function lt(e){var t,n,r,o,i,a;for(t=e.length-1;t>0;t--)for(o=e[t],n=0;n<o.length;n++)for(i=o[n],r=0;r<e[t-1].length;r++)a=e[t-1][r],x(i,a)&&(a.forward=Math.max(a.forward||0,(i.forward||0)+1))}function ut(e,n,r){function o(e,t){var n=A[e];return"object"==typeof n?Y(n,t||r):n}function i(e,t){return n.trigger.apply(n,[e,t||S].concat(Array.prototype.slice.call(arguments,2),[S]))}function a(e){return l(e)&&!o("disableDragging")}function s(e){return l(e)&&!o("disableResizing")}function l(e){return Z(e.editable,(e.source||{}).editable,o("editable"))}function d(e){R={};var t,n,r=e.length;for(t=0;r>t;t++)n=e[t],R[n._id]?R[n._id].push(n):R[n._id]=[n]}function h(e){return e.end?f(e.end):T(e)}function m(e,t){_.push(t),M[e._id]?M[e._id].push(t):M[e._id]=[t]}function g(){_=[],M={}}function p(e,t){t.click(function(n){return t.hasClass("ui-draggable-dragging")||t.hasClass("ui-resizable-resizing")?void 0:i("eventClick",this,e,n)}).hover(function(t){i("eventMouseover",this,e,t)},function(t){i("eventMouseout",this,e,t)})}function v(e,t){w(e,t,"show")}function y(e,t){w(e,t,"hide")}function w(e,t,n){var r,o=M[e._id],i=o.length;for(r=0;i>r;r++)t&&o[r][0]==t[0]||o[r][n]()}function C(e,t,n,r,o,a,s){var c=t.allDay,l=t._id;N(R[l],n,r,o),i("eventDrop",e,t,n,r,o,function(){N(R[l],-n,-r,c),D(l)},a,s),D(l)}function b(e,t,n,r,o,a){var s=t._id;E(R[s],n,r),i("eventResize",e,t,n,r,function(){E(R[s],-n,-r),D(s)},o,a),D(s)}function N(e,n,r,o){r=r||0;for(var i,a=e.length,s=0;a>s;s++)i=e[s],o!==t&&(i.allDay=o),u(c(i.start,n,!0),r),i.end&&(i.end=u(c(i.end,n,!0),r)),x(i,A)}function E(e,t,n){n=n||0;for(var r,o=e.length,i=0;o>i;i++)r=e[i],r.end=u(c(h(r),t,!0),n),x(r,A)}var S=this;S.element=e,S.calendar=n,S.name=r,S.opt=o,S.trigger=i,S.isEventDraggable=a,S.isEventResizable=s,S.reportEvents=d,S.eventEnd=h,S.reportEventElement=m,S.reportEventClear=g,S.eventElementHandlers=p,S.showEvents=v,S.hideEvents=y,S.eventDrop=C,S.eventResize=b;var T=S.defaultEventEnd,x=n.normalizeEvent,D=n.reportEventChange,R={},_=[],M={},A=n.options}function dt(){function n(e,t){var n,r,c,f,p,v,y,w,C=z(),b=D(),N=R(),E=0,S=e.length;for(C[0].innerHTML=o(e),i(e,C.children()),a(e),s(e,C,t),l(e),u(e),d(e),n=h(),r=0;b>r;r++){for(c=0,f=[],p=0;N>p;p++)f[p]=0;for(;S>E&&(v=e[E]).row==r;){for(y=V(f.slice(v.startCol,v.endCol)),v.top=y,y+=v.outerHeight,w=v.startCol;w<v.endCol;w++)f[w]=y;E++}n[r].height(V(f))}g(e,m(n))}function r(t,n,r){var a,s,c,f=e("<div/>"),p=z(),v=t.length;for(f[0].innerHTML=o(t),a=f.children(),p.append(a),i(t,a),l(t),u(t),d(t),g(t,m(h())),a=[],s=0;v>s;s++)c=t[s].element,c&&(t[s].row===n&&c.css("top",r),a.push(c[0]));return e(a)}function o(e){var t,n,r,o,i,a,s,c,l,u,d=y("isRTL"),f=e.length,h=A(),m=h.left,g=h.right,p="";for(t=0;f>t;t++)n=e[t],r=n.event,i=["fc-event","fc-event-hori"],C(r)&&i.push("fc-event-draggable"),n.isStart&&i.push("fc-event-start"),n.isEnd&&i.push("fc-event-end"),d?(a=I(n.end.getDay()-1),s=I(n.start.getDay()),c=n.isEnd?L(a):m,l=n.isStart?k(s):g):(a=I(n.start.getDay()),s=I(n.end.getDay()-1),c=n.isStart?L(a):m,l=n.isEnd?k(s):g),i=i.concat(r.className),r.source&&(i=i.concat(r.source.className||[])),o=r.url,u=J(r,y),p+=o?"<a href='"+U(o)+"'":"<div",p+=" class='"+i.join(" ")+"'"+" style='position:absolute;z-index:8;left:"+c+"px;"+u+"'"+">"+"<div class='fc-event-inner'>",!r.allDay&&n.isStart&&(p+="<span class='fc-event-time'>"+U(F(r.start,r.end,y("timeFormat")))+"</span>"),p+="<span class='fc-event-title'>"+U(r.title)+"</span>"+"</div>",n.isEnd&&b(r)&&(p+="<div class='ui-resizable-handle ui-resizable-"+(d?"w":"e")+"'>"+"&nbsp;&nbsp;&nbsp;"+"</div>"),p+="</"+(o?"a":"div")+">",n.left=c,n.outerWidth=l-c,n.startCol=a,n.endCol=s+1;return p}function i(t,n){var r,o,i,a,s,c=t.length;for(r=0;c>r;r++)o=t[r],i=o.event,a=e(n[r]),s=w("eventRender",i,i,a),s===!1?a.remove():(s&&s!==!0&&(s=e(s).css({position:"absolute",left:o.left}),a.replaceWith(s),a=s),o.element=a)}function a(e){var t,n,r,o=e.length;for(t=0;o>t;t++)n=e[t],r=n.element,r&&E(n.event,r)}function s(e,t,n){var r,o,i,a,s=e.length;for(r=0;s>r;r++)o=e[r],i=o.element,i&&(a=o.event,a._id===n?W(a,i,o):i[0]._fci=r);_(t,e,W)}function l(e){var n,r,o,i,a,s=e.length,c={};for(n=0;s>n;n++)r=e[n],o=r.element,o&&(i=r.key=j(o[0]),a=c[i],a===t&&(a=c[i]=O(o,!0)),r.hsides=a)}function u(e){var t,n,r,o=e.length;for(t=0;o>t;t++)n=e[t],r=n.element,r&&(r[0].style.width=Math.max(0,n.outerWidth-n.hsides)+"px")}function d(e){var n,r,o,i,a,s=e.length,c={};for(n=0;s>n;n++)r=e[n],o=r.element,o&&(i=r.key,a=c[i],a===t&&(a=c[i]=B(o)),r.outerHeight=o[0].offsetHeight+a)}function h(){var e,t=D(),n=[];for(e=0;t>e;e++)n[e]=M(e).find("div.fc-day-content > div");return n}function m(e){var t,n=e.length,r=[];for(t=0;n>t;t++)r[t]=e[t][0].offsetTop;return r}function g(e,t){var n,r,o,i,a=e.length;for(n=0;a>n;n++)r=e[n],o=r.element,o&&(o[0].style.top=t[r.row]+(r.top||0)+"px",i=r.event,w("eventAfterRender",i,i,o))}function p(t,n,o){var i=y("isRTL"),a=i?"w":"e",s=n.find(".ui-resizable-"+a),l=!1;K(n),n.mousedown(function(e){e.preventDefault()}).click(function(e){l&&(e.preventDefault(),e.stopImmediatePropagation())}),s.mousedown(function(s){function u(n){w("eventResizeStop",this,t,n),e("body").css("cursor",""),m.stop(),q(),d&&x(this,t,d,0,n),setTimeout(function(){l=!1},0)}if(1==s.which){l=!0;var d,h,m=v.getHoverListener(),g=D(),p=R(),y=i?-1:1,C=i?p-1:0,b=n.css("top"),E=e.extend({},t),_=H(t.start);Y(),e("body").css("cursor",a+"-resize").one("mouseup",u),w("eventResizeStart",this,t,s),m.start(function(e,n){if(e){var s=Math.max(_.row,e.row),l=e.col;1==g&&(s=0),s==_.row&&(l=i?Math.min(_.col,l):Math.max(_.col,l)),d=7*s+l*y+C-(7*n.row+n.col*y+C);var u=c(N(t),d,!0);if(d){E.end=u;var m=h;h=r(P([E]),o.row,b),h.find("*").css("cursor",a+"-resize"),m&&m.remove(),T(t)}else h&&(S(t),h.remove(),h=null);q(),$(t.start,c(f(u),1))}},s)}})}var v=this;v.renderDaySegs=n,v.resizableDayEvent=p;var y=v.opt,w=v.trigger,C=v.isEventDraggable,b=v.isEventResizable,N=v.eventEnd,E=v.reportEventElement,S=v.showEvents,T=v.hideEvents,x=v.eventResize,D=v.getRowCnt,R=v.getColCnt;v.getColWidth;var M=v.allDayRow,A=v.allDayBounds,L=v.colContentLeft,k=v.colContentRight,I=v.dayOfWeekCol,H=v.dateCell,P=v.compileDaySegs,z=v.getDaySegmentContainer,W=v.bindDaySeg,F=v.calendar.formatDates,$=v.renderDayOverlay,q=v.clearOverlays,Y=v.clearSelection}function ft(){function t(e,t,o){n(),t||(t=c(e,o)),l(e,t,o),r(e,t,o)}function n(e){d&&(d=!1,u(),s("unselect",null,e))}function r(e,t,n,r){d=!0,s("select",null,e,t,n,r)}function o(t){var o=i.cellDate,s=i.cellIsAllDay,c=i.getHoverListener(),d=i.reportDayClick;if(1==t.which&&a("selectable")){n(t);var f;c.start(function(e,t){u(),e&&s(e)?(f=[o(t),o(e)].sort($),l(f[0],f[1],!0)):f=null},t),e(document).one("mouseup",function(e){c.stop(),f&&(+f[0]==+f[1]&&d(f[0],!0,e),r(f[0],f[1],!0,e))})}}var i=this;i.select=t,i.unselect=n,i.reportSelection=r,i.daySelectionMousedown=o;var a=i.opt,s=i.trigger,c=i.defaultSelectionEnd,l=i.renderSelection,u=i.clearSelection,d=!1;a("selectable")&&a("unselectAuto")&&e(document).mousedown(function(t){var r=a("unselectCancel");r&&e(t.target).parents(r).length||n(t)})}function ht(){function t(t,n){var r=i.shift();return r||(r=e("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>")),r[0].parentNode!=n[0]&&r.appendTo(n),o.push(r.css(t).show()),r}function n(){for(var e;e=o.shift();)i.push(e.hide().unbind())}var r=this;r.renderOverlay=t,r.clearOverlays=n;var o=[],i=[]}function mt(e){var t,n,r=this;r.build=function(){t=[],n=[],e(t,n)},r.cell=function(e,r){var o,i=t.length,a=n.length,s=-1,c=-1;for(o=0;i>o;o++)if(r>=t[o][0]&&r<t[o][1]){s=o;break}for(o=0;a>o;o++)if(e>=n[o][0]&&e<n[o][1]){c=o;break}return s>=0&&c>=0?{row:s,col:c}:null},r.rect=function(e,r,o,i,a){var s=a.offset();return{top:t[e][0]-s.top,left:n[r][0]-s.left,width:n[i][1]-n[r][0],height:t[o][1]-t[e][0]}}}function gt(t){function n(e){pt(e);var n=t.cell(e.pageX,e.pageY);(!n!=!a||n&&(n.row!=a.row||n.col!=a.col))&&(n?(i||(i=n),o(n,i,n.row-i.row,n.col-i.col)):o(n,i),a=n)}var r,o,i,a,s=this;s.start=function(s,c,l){o=s,i=a=null,t.build(),n(c),r=l||"mousemove",e(document).bind(r,n)},s.stop=function(){return e(document).unbind(r,n),a}}function pt(e){e.pageX===t&&(e.pageX=e.originalEvent.pageX,e.pageY=e.originalEvent.pageY)}function vt(e){function n(t){return o[t]=o[t]||e(t)}var r=this,o={},i={},a={};r.left=function(e){return i[e]=i[e]===t?n(e).position().left:i[e]},r.right=function(e){return a[e]=a[e]===t?r.left(e)+n(e).width():a[e]},r.clear=function(){o={},i={},a={}}}var yt={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"iso",weekNumberTitle:"W",allDayDefault:!0,ignoreTimezone:!0,lazyFetching:!0,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:!1,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"<span class='fc-text-arrow'>&lsaquo;</span>",next:"<span class='fc-text-arrow'>&rsaquo;</span>",prevYear:"<span class='fc-text-arrow'>&laquo;</span>",nextYear:"<span class='fc-text-arrow'>&raquo;</span>",today:"today",month:"month",week:"week",day:"day"},theme:!1,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:!0,dropAccept:"*"},wt={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"<span class='fc-text-arrow'>&rsaquo;</span>",next:"<span class='fc-text-arrow'>&lsaquo;</span>",prevYear:"<span class='fc-text-arrow'>&raquo;</span>",nextYear:"<span class='fc-text-arrow'>&laquo;</span>"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Ct=e.fullCalendar={version:"1.6.1"},bt=Ct.views={};e.fn.fullCalendar=function(n){if("string"==typeof n){var o,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var r=e.data(this,"fullCalendar");if(r&&e.isFunction(r[n])){var a=r[n].apply(r,i);o===t&&(o=a),"destroy"==n&&e.removeData(this,"fullCalendar")}}),o!==t?o:this}var a=n.eventSources||[];return delete n.eventSources,n.events&&(a.push(n.events),delete n.events),n=e.extend(!0,{},yt,n.isRTL||n.isRTL===t&&yt.isRTL?wt:{},n),this.each(function(t,o){var i=e(o),s=new r(i,n,a);i.data("fullCalendar",s),s.render()}),this},Ct.sourceNormalizers=[],Ct.sourceFetchers=[];var Nt={dataType:"json",cache:!1},Et=1;Ct.addDays=c,Ct.cloneDate=f,Ct.parseDate=v,Ct.parseISO8601=y,Ct.parseTime=w,Ct.formatDate=C,Ct.formatDates=b;var St=["sun","mon","tue","wed","thu","fri","sat"],Tt=864e5,xt=36e5,Dt=6e4,Rt={s:function(e){return e.getSeconds()},ss:function(e){return q(e.getSeconds())},m:function(e){return e.getMinutes()},mm:function(e){return q(e.getMinutes())},h:function(e){return e.getHours()%12||12},hh:function(e){return q(e.getHours()%12||12)},H:function(e){return e.getHours()},HH:function(e){return q(e.getHours())},d:function(e){return e.getDate()},dd:function(e){return q(e.getDate())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return e.getMonth()+1},MM:function(e){return q(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},yy:function(e){return(e.getFullYear()+"").substring(2)},yyyy:function(e){return e.getFullYear()},t:function(e){return e.getHours()<12?"a":"p"},tt:function(e){return e.getHours()<12?"am":"pm"},T:function(e){return e.getHours()<12?"A":"P"},TT:function(e){return e.getHours()<12?"AM":"PM"},u:function(e){return C(e,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(e){var t=e.getDate();return t>10&&20>t?"th":["st","nd","rd"][t%10-1]||"th"},w:function(e,t){return t.weekNumberCalculation(e)},W:function(e){return N(e)}};Ct.dateFormatters=Rt,Ct.applyAll=Q,bt.month=et,bt.basicWeek=tt,bt.basicDay=nt,n({weekMode:"fixed"}),bt.agendaWeek=it,bt.agendaDay=at,n({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:.5},minTime:0,maxTime:24})}(jQuery);